import Vue from 'vue';
import Router from 'vue-router';
import routes from './router';

import { storageClean } from '@/utill/storage.js'

Vue.use(Router);

const router = new Router({
  routes,
  mode: 'history',
});

// 跳转之前
router.beforeEach((to, from, next) => {
  if (to.path === '/login') {
    storageClean();
  }

  next();
});

// 跳转之后
// router.afterEach(() => {});

export default router;